#include <stdio.h>
#include "avlTree.h"
#include <stdlib.h>
#include <time.h>

int main()
{
    int i = 0;
    AvlTree root = NULL;
    Position tmp = NULL;
    /*

        srand((unsigned int)time(NULL));
        for (i = 0; i < 10; i++)s
        {
            root = Insert(rand() % 10000, root);
        }
    */
    root = Insert(4, root);
    root = Insert(2, root);
    root = Insert(6, root);
    root = Insert(1, root);
    root = Insert(3, root);
    root = Insert(5, root);
    root = Insert(7, root);

    Print(root);


    tmp = FindMin(root);
    printf("The min is %d\n", tmp->Element);
    tmp = FindMax(root);
    printf("The max is %d\n", tmp->Element);

    root = Insert(16, root);
    root = Insert(15, root);
    root = Insert(14, root);
    root = Insert(13, root);
    root = Insert(12, root);
    root = Insert(11, root);
    root = Insert(10, root);
    root = Insert(8, root);
    root = Insert(9, root);

    Print(root);
    root = MakeEmpty(root);
    Print(root);

    return 0;
}